package com.aaa.ssm.service.impl;

import com.aaa.ssm.entity.TAbout;
import com.aaa.ssm.dao.TAboutDao;
import com.aaa.ssm.service.TAboutService;
import com.aaa.ssm.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;

/**
 * 关于表(TAbout)表服务实现类
 *
 * @author makejava
 * @since 2023-04-04 16:19:36
 */
@Service("tAboutService")
public class TAboutServiceImpl implements TAboutService {
    @Resource
    private TAboutDao tAboutDao;

    @Override
    public PageInfo queryById(Page<TAbout> tAbout) {
        PageHelper.startPage(tAbout.getPageNo(),tAbout.getPageSize());
        return new PageInfo(tAboutDao.queryById(tAbout.getData()));
    }


    /**
     * 新增数据
     *
     * @param tAbout 实例对象
     * @return 实例对象
     */
    @Override
    public TAbout insert(TAbout tAbout) {
        this.tAboutDao.insert(tAbout);
        return tAbout;
    }

    /**
     * 修改数据
     *
     * @param tAbout 实例对象
     * @return 实例对象
     */
    @Override
    public int update(TAbout tAbout) {
        return tAboutDao.update(tAbout);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public int deleteById(String id) {
        return this.tAboutDao.deleteById(id);
    }
}
